<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
if($_RQ['op']=='main'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		foreach($postdata['feetypes'] as $lv){
			if(!$lv['name']){
				exi('标识必填，而且不能重复的！','error');
			}
		}
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}
	$plugins =$this->plugins();
	$return['item']=$this->plugin_setting('basic');
	$htmls=array(
		'type'=>'edit',
		'edit'=>array(
			array(
							'type'=>'array',
							'name'=>'feetypes',
							'add_tip'=>'添加一个费用类型',
								'list'=>array(
									array('type'=>'string','name'=>'title','title'=>'名称'),
									array('type'=>'string','name'=>'name','title'=>'标识'),
								),
								'details'=>array(
									array('type'=>'string','name'=>'title','title'=>'名称'),
									array('type'=>'string','name'=>'name','title'=>'标识','help'=>'一般是英文字母：例如：shop'),
								)
			)
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}


